package web.ling.por

class ProofreadingOrder {

    Client client
    Provider provider
    List<Application> applyingProviders = []

    OrderStatus orderStatus
    FieldOfExpertise fieldOfExpertise

    Date deadlineDate
    Date finishedDate
    Date submissionDate
    Date acceptedDate

    byte[] document
    String documentType

    String summary

    Language language

    String feedbackComment
    Integer feedbackRating

    BigDecimal orderPrice
    Boolean paymentProcessed = false

    static hasMany = [applyingProviders : Application]

    static constraints = {

        provider nullable: true

        finishedDate nullable: true
        acceptedDate nullable: true

        document nullable: false, maxSize: 1024*1024*50
        documentType inList: ['pdf', 'doc']

        summary nullable: false, size: 10..500

        feedbackComment nullable: true
        feedbackRating nullable: true

        orderPrice nullable: false, blank: false
    }
}
